<?php

class TestimonyController extends Controller {

    public function actionIndex() {
        $testimony_criteria = new CDbCriteria;
        $testimony_criteria->condition = "member_testimony_is_approve = '1'";
        $testimony_criteria->order = "member_testimony_order_by ASC";

        $testimony_pagination = new CPagination(sys_member_testimony::model()->count($testimony_criteria));
        $testimony_pagination->pageSize = Yii::app()->params['testimonyPerPage'];
        $testimony_pagination->applyLimit($testimony_criteria);

        $testimony_model = sys_member_testimony::model()->findAll($testimony_criteria);

        $this->render('index', array('testimony_model' => $testimony_model, 'testimony_pagination' => $testimony_pagination));
    }

}
